package com.demo.bookstore.service.impl;

import com.demo.bookstore.bean.Book;
import com.demo.bookstore.dao.BookDao;
import com.demo.bookstore.dao.impl.BookDaoImpl;
import com.demo.bookstore.service.BookService;

import java.util.List;

/**
 * @author ddone
 * @date 2024/3/14-20:42
 */
public class BookServiceImpl implements BookService {
    private BookDao bookDao = new BookDaoImpl();
    @Override
    public List<Book> findBookList() {
       return bookDao.findBookList();
    }

    @Override
    public int addBook(Book book) {
        return bookDao.addBook(book);
    }

    @Override
    public int deleteBook(String id) {
        return bookDao.deleteBook(Integer.parseInt(id));
    }

    @Override
    public Book findBookById(String id) {
        return bookDao.findBookById(Integer.parseInt(id));
    }

    @Override
    public int updateBook(Book book) {
        return bookDao.updateBook(book);
    }
}
